package com.xjh.basestudy.javabase.threadjiu;

public class GetMoney implements Runnable {
    private BankAccount account;
    private int cash;

    public GetMoney(BankAccount account, int cash) {
        this.account = account;
        this.cash = cash;
    }

    public void run() {
        String name = Thread.currentThread().getName();
        System.out.println("线程\"" + name + "\"开始取钱!");
        account.getMoneyOutOfBank(cash);
        System.out.println("线程\"" + name + "\"取钱完毕!");
    }
}


